import { dom, Nodes } from '@knno/dom';

export class Icon extends Nodes {
	constructor(icon: string) {
		super(dom.html(icon).elems());
	}

	size(size: string) {
		this.css({
			width: size,
			height: size,
		});
	}

	color(color: string) {
		this.css({
			fill: color,
		});
	}
}

export function icon(svg: string, ...className: string[]): Icon {
	return new Icon(svg).addClass(...className);
}
